package com.qls.consumer.biz.config;

import com.qls.consumer.biz.service.Queue;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * @author doyoung
 */
@Configuration
@Slf4j
public class Init {

    @Autowired
    private Queue queue;

    @PostConstruct
    public void create() {

        try {
            queue.basic();
            log.info("------初始化系统任务队列------");
        } catch (Exception e) {
            log.warn("------初始化系统队列失败------");
            e.printStackTrace();
        }

    }

}
